// test_log.cpp
#include "Log.hpp"   // 把之前给你的代码全部塞到 Log.hpp 里即可
#include <thread>
#include <vector>

int main()
{
    /* 1. 控制台日志 */
    LogModule::ENABLE_DISPLAY_LOG_STRATEGY();
    LogModule::LOG(LogModule::LogLevel::INFO) << "hello from display strategy";

    /* 2. 文件日志 */
    LogModule::ENABLE_FILE_LOG_STRATEGY();
    LogModule::LOG(LogModule::LogLevel::DEBUG)   << "first file line";
    LogModule::LOG(LogModule::LogLevel::WARNING) << "second file line";

    /* 3. 多线程并发写日志 */
    auto worker = [](int id) {
        for (int i = 0; i < 5; ++i)
            LogModule::LOG(LogModule::LogLevel::INFO)
                << "[thread " << id << "] count = " << i;
    };

    std::vector<std::thread> pool;
    pool.emplace_back(worker, 1);
    pool.emplace_back(worker, 2);

    for (auto& t : pool) t.join();

    return 0;
}